package com.naiterui.ehp.bs.cms.modules.pharmacy.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.cms.modules.pharmacy.vo.WarehouseManageVO;

@RequestMapping("/inner/warehouse")
@FeignClient(name = "dsWarehouse", url = "${ehp.domain.ds}", configuration = FeignConfiguration.class)
public interface DsWarehouseFeignClient {

    @GetMapping("/userName/{warehouseId}")
    String getUserName(@PathVariable("warehouseId") Long warehouseId) throws BusinessException;

    @PostMapping("/manage/{warehouseId}")
    void manage(@PathVariable("warehouseId") Long warehouseId, @RequestBody WarehouseManageVO warehouseManage) throws BusinessException;

    /**
     * 更新状态
     */
    @PutMapping("/{id}/{status}")
    void updateStatus(@PathVariable("id") Long id, @PathVariable("status") Integer status) throws BusinessException;

}
